﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="classUpdate.aspx.cs" Inherits="Inter.MianShi.Webfrom.classUpdate" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="Css/bootstrap.css" rel="stylesheet" />
    <link href="Css/bootstrap-responsive.css" rel="stylesheet" />
    <link href="Css/style.css" rel="stylesheet" />
    <script src="js/jquery2.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/ckform.js"></script>
    <script src="js/common.js"></script>
    <script src="js/jquerypicture.js"></script>
        <style type="text/css">
        body {font-size: 20px;
            padding-bottom: 40px;
            background-color:#e9e7ef;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>    <script>
        var id= <%=ID%>;//这就是ID   ni 运行一下我看看yunxingyixia
       debugger
        $(function () {
            $.ajax({
                url: "/Hander/UptCompany.ashx",
                type: "post",
                dataType: "json",
                data:{
                    id:id
                },
                success: function (data) {
                    $("#ca").val(data.CompanyId);
                    $("#name").val(data.CompanyName);
                    $("#miao").val(data.CompanyCompany);
                }
            })
        })
        //$("#button1").click(function(){
        //    var name=$("#name").val();
        //    var miao=$("#miao").val();
        //    var id=$("#ca").val();
        //    $.ajax({
        //        url:"Hander/UptdateCompany.ashx",
        //        type:"post",
        //        data:{
        //            id:id,
        //            name:name,
        //            miao:miao
        //        },
        //        success:function(data){
        //            alert(data);
        //            if(data>0)
        //            {
        //                alert('修改成功');
        //                location.href='classQuery.aspx';
        //            }
        //            else
        //            {
        //                alert('保存失败')
        //            }
        //        }
        //    })
        //})
        function Uptdate(){
            var name=$("#name").val();
            var miao=$("#miao").val();
            var id=$("#ca").val();
            $.ajax({
                url:"Hander/UptdateCompany.ashx",
                type:"post",
                data:{
                    id:id,
                    name:name,
                    miao:miao
                },
                success:function(data){
                    alert(data);
                    if(data>0)
                    {
                        alert('修改成功');
                        location.href='classQuery.aspx';
                    }
                    else
                    {
                        alert('保存失败')
                    }
                }
            })
        }
    </script>
</head>
<body>
<font color="#777777"><strong>修改大类：</strong></font> 
<form action="#" method="post" class="definewidth m20" enctype="multipart/form-data">
<table style="margin-left:10px;margin-top:3px;">
    <tr>
         <td>公司编号：</td>
		 <td><input type="text" name="classname" id="ca"/></td>
    </tr>
    <tr>
         <td>公司名称：</td>
		 <td><input type="text" name="classname" id="name"/></td>
    </tr>
	<tr>
         <td>公司介绍：</td>
		 <td><input type="text" name="classname" style="height: 100px;wight：200px;" id="miao"/></td>
    </tr>
	
    <tr>
        
       <td>
            <button style="margin-left:5px;"type="submit" class="btn btn-primary" type="button" id="button1" onclick="Uptdate()"  >保&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp存</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid"> <a href="classQuery.html"> 返回列表</a></button>
        </td>
    </tr>
</table>
</form>


</body>
</html>
